/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CadastroCliente.java
 *
 * Created on 11/02/2010, 12:28:15
 */

package documenteditor.view;

import documenteditor.controller.CidadeJpaController;
import documenteditor.controller.ClienteJpaController;
import documenteditor.controller.EstadoJpaController;
import documenteditor.controller.TimeFutebolJpaController;
import documenteditor.controller.exceptions.NonexistentEntityException;
import documenteditor.entidade.model.ClientePessoaFisica;
import documenteditor.entidade.model.Endereco;
import documenteditor.entidade.model.Telefone;
import documenteditor.entidade.model.TimeFutebol;
import documenteditor.entidade.model.dominio.Cidade;
import documenteditor.entidade.model.dominio.Estado;
import documenteditor.entidade.model.dominio.Sexo;
import documenteditor.entidade.model.dominio.TipoEndereco;
import documenteditor.entidade.model.dominio.TipoTelefone;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import org.jdesktop.application.Action;

/**
 *
 * @author gleidson.moura
 */
public class CadastroCliente extends javax.swing.JPanel {

    private ClientePessoaFisica cliente;
    private Endereco endereco;

    /** Creates new form CadastroCliente */
    public CadastroCliente(ClientePessoaFisica cliente) {
        setQtdPontos(cliente.getCartaoFidelidade() != null ? cliente.getCartaoFidelidade().toString() : "0");
        this.cliente = cliente;
        this.endereco = carregarEndereco(TipoEndereco.RESIDENCIAL, Boolean.TRUE);
        initComponents();
        jComboBoxTipoEndereco.setModel(new DefaultComboBoxModel(TipoEndereco.values()));
        jComboBoxTipoEndereco.setSelectedItem(endereco.getTipoEndereco() != null ? endereco.getTipoEndereco().toString() : "[Selecione]");
        carregarEstados();
        carregarTimeFutebol();
    }

    public Endereco getEndereco() {
        return endereco;
    }

    public void setEndereco(Endereco endereco) {
        this.endereco = endereco;
    }

    public ClientePessoaFisica getCliente() {
        return cliente;
    }

    public void setCliente(ClientePessoaFisica cliente) {
        this.cliente = cliente;
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelTituloCadCliente = new javax.swing.JLabel();
        jLabelNome = new javax.swing.JLabel();
        jTextFieldNome = new javax.swing.JTextField();
        jLabelDataNasc = new javax.swing.JLabel();
        jFormattedTextFieldDataNascimento = new javax.swing.JFormattedTextField();
        jLabelEmail = new javax.swing.JLabel();
        jTextFieldEmail = new javax.swing.JTextField();
        jLabelTelRes = new javax.swing.JLabel();
        jFormattedTextFieldTelRes = new javax.swing.JFormattedTextField();
        jLabelTelCel = new javax.swing.JLabel();
        jFormattedTextFieldTelCel = new javax.swing.JFormattedTextField();
        jLabelTelCom = new javax.swing.JLabel();
        jFormattedTextFieldTelCom = new javax.swing.JFormattedTextField();
        jSeparator1 = new javax.swing.JSeparator();
        jLabelTextoEndereco = new javax.swing.JLabel();
        jLabelRua = new javax.swing.JLabel();
        jTextFieldRua = new javax.swing.JTextField();
        jLabelNumero = new javax.swing.JLabel();
        jTextFieldNumero = new javax.swing.JTextField();
        jLabelComplemento = new javax.swing.JLabel();
        jTextFieldComplemento = new javax.swing.JTextField();
        jLabelEstado = new javax.swing.JLabel();
        jComboBoxEstado = new javax.swing.JComboBox();
        jLabelCidade = new javax.swing.JLabel();
        jComboBoxCidade = new javax.swing.JComboBox();
        jLabelReferencia = new javax.swing.JLabel();
        jTextFieldReferencia = new javax.swing.JTextField();
        jLabelTipoEndereco = new javax.swing.JLabel();
        jComboBoxTipoEndereco = new javax.swing.JComboBox();
        jLabelCep = new javax.swing.JLabel();
        jFormattedTextFieldCep = new javax.swing.JFormattedTextField();
        jLabelBairro = new javax.swing.JLabel();
        jTextFieldBairro = new javax.swing.JTextField();
        jSeparator2 = new javax.swing.JSeparator();
        jLabelPreferencias = new javax.swing.JLabel();
        jLabelTimeFutebol = new javax.swing.JLabel();
        jComboBoxTimeFutebol = new javax.swing.JComboBox();
        jPanel1 = new javax.swing.JPanel();
        jButtonQtdPontos = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jButtonSalvar = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jComboBoxSexo = new javax.swing.JComboBox();
        jLabelCPF = new javax.swing.JLabel();
        jFormattedTextFieldCPF = new javax.swing.JFormattedTextField();

        setName("formCadastroCliente"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(documenteditor.DocumentEditorApp.class).getContext().getResourceMap(CadastroCliente.class);
        jLabelTituloCadCliente.setFont(resourceMap.getFont("labelTituloTelaCadastroCliente.font")); // NOI18N
        jLabelTituloCadCliente.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTituloCadCliente.setText(resourceMap.getString("labelTituloTelaCadastroCliente.text")); // NOI18N
        jLabelTituloCadCliente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabelTituloCadCliente.setName("labelTituloTelaCadastroCliente"); // NOI18N

        jLabelNome.setText(resourceMap.getString("labelNomeCliente.text")); // NOI18N
        jLabelNome.setName("labelNomeCliente"); // NOI18N

        jTextFieldNome.setText(cliente != null ? cliente.getNomeCliente() : "");
        jTextFieldNome.setToolTipText(resourceMap.getString("jTextFieldNome.toolTipText")); // NOI18N
        jTextFieldNome.setName("jTextFieldNome"); // NOI18N

        jLabelDataNasc.setText(resourceMap.getString("jLabelDataNasc.text")); // NOI18N
        jLabelDataNasc.setName("jLabelDataNasc"); // NOI18N

        try {
            jFormattedTextFieldDataNascimento.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextFieldDataNascimento.setText(getDataNascimento());
        jFormattedTextFieldDataNascimento.setToolTipText(resourceMap.getString("formattedTextFieldDataNascimento.toolTipText")); // NOI18N
        jFormattedTextFieldDataNascimento.setName("formattedTextFieldDataNascimento"); // NOI18N

        jLabelEmail.setText(resourceMap.getString("jLabelEmail.text")); // NOI18N
        jLabelEmail.setName("jLabelEmail"); // NOI18N

        jTextFieldEmail.setText(cliente != null ? cliente.getEmail() : "");
        jTextFieldEmail.setName("jTextFieldEmail"); // NOI18N

        jLabelTelRes.setText(resourceMap.getString("jLabelTelRes.text")); // NOI18N
        jLabelTelRes.setName("jLabelTelRes"); // NOI18N

        try {
            jFormattedTextFieldTelRes.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##) ####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextFieldTelRes.setText(getTelefonePorTipo(TipoTelefone.RESIDENCIAL));
        jFormattedTextFieldTelRes.setToolTipText(resourceMap.getString("jFormattedTextFieldTelRes.toolTipText")); // NOI18N
        jFormattedTextFieldTelRes.setName("jFormattedTextFieldTelRes"); // NOI18N

        jLabelTelCel.setText(resourceMap.getString("jLabelTelCel.text")); // NOI18N
        jLabelTelCel.setName("jLabelTelCel"); // NOI18N

        try {
            jFormattedTextFieldTelCel.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##) ####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextFieldTelCel.setText(getTelefonePorTipo(TipoTelefone.CELULAR));
        jFormattedTextFieldTelCel.setToolTipText(resourceMap.getString("jFormattedTextFieldTelCel.toolTipText")); // NOI18N
        jFormattedTextFieldTelCel.setName("jFormattedTextFieldTelCel"); // NOI18N

        jLabelTelCom.setText(resourceMap.getString("jLabelTelCom.text")); // NOI18N
        jLabelTelCom.setName("jLabelTelCom"); // NOI18N

        try {
            jFormattedTextFieldTelCom.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##) ####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextFieldTelCom.setText(getTelefonePorTipo(TipoTelefone.COMERCIAL));
        jFormattedTextFieldTelCom.setToolTipText(resourceMap.getString("jFormattedTextFieldTelCom.toolTipText")); // NOI18N
        jFormattedTextFieldTelCom.setName("jFormattedTextFieldTelCom"); // NOI18N

        jSeparator1.setName("jSeparator1"); // NOI18N

        jLabelTextoEndereco.setFont(resourceMap.getFont("jLabelTextoEndereco.font")); // NOI18N
        jLabelTextoEndereco.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelTextoEndereco.setText(resourceMap.getString("jLabelTextoEndereco.text")); // NOI18N
        jLabelTextoEndereco.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabelTextoEndereco.setName("jLabelTextoEndereco"); // NOI18N

        jLabelRua.setText(resourceMap.getString("jLabelRua.text")); // NOI18N
        jLabelRua.setName("jLabelRua"); // NOI18N

        jTextFieldRua.setText(endereco.getNomeRua() != null ? endereco.getNomeRua() : "");
        jTextFieldRua.setName("jTextFieldRua"); // NOI18N

        jLabelNumero.setText(resourceMap.getString("jLabelNumero.text")); // NOI18N
        jLabelNumero.setName("jLabelNumero"); // NOI18N

        jTextFieldNumero.setText(endereco.getNumero() != null ? endereco.getNumero().toString() : "");
        jTextFieldNumero.setName("jTextFieldNumero"); // NOI18N
        jTextFieldNumero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldNumeroActionPerformed(evt);
            }
        });

        jLabelComplemento.setText(resourceMap.getString("jLabelComplemento.text")); // NOI18N
        jLabelComplemento.setName("jLabelComplemento"); // NOI18N

        jTextFieldComplemento.setText(endereco.getComplemento() != null ? endereco.getComplemento() : "");
        jTextFieldComplemento.setName("jTextFieldComplemento"); // NOI18N

        jLabelEstado.setText(resourceMap.getString("jLabelEstado.text")); // NOI18N
        jLabelEstado.setName("jLabelEstado"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(documenteditor.DocumentEditorApp.class).getContext().getActionMap(CadastroCliente.class, this);
        jComboBoxEstado.setAction(actionMap.get("carregarCidades")); // NOI18N
        jComboBoxEstado.setName("jComboBoxEstado"); // NOI18N

        jLabelCidade.setText(resourceMap.getString("jLabelCidade.text")); // NOI18N
        jLabelCidade.setName("jLabelCidade"); // NOI18N

        jComboBoxCidade.setName("jComboBoxCidade"); // NOI18N

        jLabelReferencia.setText(resourceMap.getString("jLabelReferencia.text")); // NOI18N
        jLabelReferencia.setName("jLabelReferencia"); // NOI18N

        jTextFieldReferencia.setText(endereco.getReferencia() != null ? endereco.getReferencia() : "");
        jTextFieldReferencia.setToolTipText(resourceMap.getString("jTextFieldReferencia.toolTipText")); // NOI18N
        jTextFieldReferencia.setName("jTextFieldReferencia"); // NOI18N
        jTextFieldReferencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldReferenciaActionPerformed(evt);
            }
        });

        jLabelTipoEndereco.setText(resourceMap.getString("jLabelTipoEndereco.text")); // NOI18N
        jLabelTipoEndereco.setName("jLabelTipoEndereco"); // NOI18N

        jComboBoxTipoEndereco.setAction(actionMap.get("getEnderecoPorTipo")); // NOI18N
        jComboBoxTipoEndereco.setName("jComboBoxTipoEndereco"); // NOI18N

        jLabelCep.setText(resourceMap.getString("jLabelCep.text")); // NOI18N
        jLabelCep.setName("jLabelCep"); // NOI18N

        try {
            jFormattedTextFieldCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextFieldCep.setText(endereco.getCep() != null ? endereco.getCep().toString() : "");
        jFormattedTextFieldCep.setToolTipText(resourceMap.getString("jFormattedTextFieldCep.toolTipText")); // NOI18N
        jFormattedTextFieldCep.setName("jFormattedTextFieldCep"); // NOI18N

        jLabelBairro.setText(resourceMap.getString("jLabelBairro.text")); // NOI18N
        jLabelBairro.setName("jLabelBairro"); // NOI18N

        jTextFieldBairro.setText(endereco.getBairro() != null ? endereco.getBairro() : "");
        jTextFieldBairro.setName("jTextFieldBairro"); // NOI18N

        jSeparator2.setName("jSeparator2"); // NOI18N

        jLabelPreferencias.setFont(resourceMap.getFont("jLabelPreferencias.font")); // NOI18N
        jLabelPreferencias.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelPreferencias.setText(resourceMap.getString("jLabelPreferencias.text")); // NOI18N
        jLabelPreferencias.setToolTipText(resourceMap.getString("jLabelPreferencias.toolTipText")); // NOI18N
        jLabelPreferencias.setName("jLabelPreferencias"); // NOI18N

        jLabelTimeFutebol.setText(resourceMap.getString("jLabelTimeFutebol.text")); // NOI18N
        jLabelTimeFutebol.setName("jLabelTimeFutebol"); // NOI18N

        jComboBoxTimeFutebol.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "[selecione]" }));
        jComboBoxTimeFutebol.setName("jComboBoxTimeFutebol"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        jButtonQtdPontos.setFont(resourceMap.getFont("jButtonPontos.font")); // NOI18N
        jButtonQtdPontos.setText(getQtdPontos());
        jButtonQtdPontos.setName("jButtonPontos"); // NOI18N

        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setFocusable(false);
        jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel1.setName("jLabel1"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
            .addComponent(jButtonQtdPontos, javax.swing.GroupLayout.PREFERRED_SIZE, 149, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonQtdPontos, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jButtonSalvar.setAction(actionMap.get("salvarCliente")); // NOI18N
        jButtonSalvar.setText(resourceMap.getString("jButtonSalvar.text")); // NOI18N
        jButtonSalvar.setName("jButtonSalvar"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jComboBoxSexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "[Selecione]", "Feminino", "Masculino" }));
        jComboBoxSexo.setSelectedItem(getSexo(cliente));
        jComboBoxSexo.setName("jComboBoxSexo"); // NOI18N

        jLabelCPF.setText(resourceMap.getString("jLabelCPF.text")); // NOI18N
        jLabelCPF.setName("jLabelCPF"); // NOI18N

        try {
            jFormattedTextFieldCPF.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextFieldCPF.setText(getCPF(cliente));
        jFormattedTextFieldCPF.setToolTipText(resourceMap.getString("jFormattedTextFieldCPF.toolTipText")); // NOI18N
        jFormattedTextFieldCPF.setName("jFormattedTextFieldCPF"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 1069, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelTipoEndereco)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxTipoEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(691, 691, 691))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelTimeFutebol)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxTimeFutebol, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(820, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabelTextoEndereco, javax.swing.GroupLayout.DEFAULT_SIZE, 1069, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabelTituloCadCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 1069, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabelTelRes, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldTelRes, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabelTelCel, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldTelCel, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabelNome, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextFieldNome)))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabelEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextFieldEmail))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabelTelCom)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldTelCom, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabelDataNasc, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldDataNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabelCPF)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jFormattedTextFieldCPF, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jButtonSalvar)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelPreferencias, javax.swing.GroupLayout.DEFAULT_SIZE, 1069, Short.MAX_VALUE)
                            .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 1069, Short.MAX_VALUE))
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jLabelEstado)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxEstado, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabelCidade)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabelReferencia)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextFieldReferencia, javax.swing.GroupLayout.DEFAULT_SIZE, 535, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addComponent(jLabelBairro)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldBairro))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addComponent(jLabelRua)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldRua, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE)))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabelNumero)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldNumero, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabelComplemento)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldComplemento, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabelCep)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jFormattedTextFieldCep, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabelTituloCadCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(41, 41, 41)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNome)
                            .addComponent(jTextFieldNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelEmail)
                            .addComponent(jLabel2)
                            .addComponent(jComboBoxSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelTelRes)
                            .addComponent(jFormattedTextFieldTelRes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelTelCel)
                            .addComponent(jFormattedTextFieldTelCel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelTelCom)
                            .addComponent(jFormattedTextFieldTelCom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelDataNasc)
                            .addComponent(jFormattedTextFieldDataNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelCPF)
                            .addComponent(jFormattedTextFieldCPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelTextoEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelTipoEndereco)
                            .addComponent(jComboBoxTipoEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelRua)
                            .addComponent(jTextFieldRua, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelBairro)
                            .addComponent(jTextFieldBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelNumero)
                            .addComponent(jTextFieldNumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelComplemento)
                            .addComponent(jTextFieldComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelCep)
                            .addComponent(jFormattedTextFieldCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelEstado)
                    .addComponent(jComboBoxEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelCidade)
                    .addComponent(jComboBoxCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelReferencia)
                    .addComponent(jTextFieldReferencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(13, 13, 13)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelPreferencias)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTimeFutebol)
                    .addComponent(jComboBoxTimeFutebol, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                .addComponent(jButtonSalvar)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldNumeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldNumeroActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldNumeroActionPerformed

    private void jTextFieldReferenciaActionPerformed(java.awt.event.ActionEvent evt) {                                                     
        // TODO add your handling code here:
    }

    @Action
    public void carregarCidades() {
        Estado estado = (Estado) jComboBoxEstado.getSelectedItem();
        carregarCidade(estado);
    }

    private String getTelefonePorTipo(TipoTelefone tipoTelefone) {
        if (cliente != null) {
            List<Telefone> tels = cliente.getTelefones();
            for (Telefone telefone : tels) {
                if (telefone.getTipoTelefone().equals(tipoTelefone)) {
                    return telefone.getDdd().toString() + telefone.getNumeroTelefone().toString();
                }
            }
        }
        return "";
   }

   private String getDataNascimento() {
       if (cliente != null && ((ClientePessoaFisica)cliente).getDataNascimento() != null) {
           SimpleDateFormat df = new SimpleDateFormat("ddMMyyyy");
           return df.format(((ClientePessoaFisica)cliente).getDataNascimento());
       }
       return "";
   }


    @Action
    public void getEnderecoPorTipo() {
        TipoEndereco tipoEndereco = null;
        String tipoStr = jComboBoxTipoEndereco.getSelectedItem().toString();
        if (!tipoStr.equals("[Selecione]")) {
            tipoEndereco = TipoEndereco.valueOf(tipoStr);
        }
        preencherCamposEndereco(carregarEndereco(tipoEndereco, Boolean.FALSE), Boolean.FALSE);
    }

    @Action
    public void salvarCliente() {
        String nome = jTextFieldNome.getText();
        String email = jTextFieldEmail.getText();
        Date dataNasc = converteData(jFormattedTextFieldDataNascimento.getText());
        String sexoStr = null;
        String cpfStr = jFormattedTextFieldCPF.getText();
        switch (jComboBoxSexo.getSelectedIndex()) {
            case 1 : sexoStr = "F"; break;
            case 2 : sexoStr = "M"; break;
            default: sexoStr = null; break;
        }
        TipoEndereco tipoEndereco = (TipoEndereco) jComboBoxTipoEndereco.getSelectedItem();
        Boolean enderecoPreenchido = Boolean.FALSE;
        for (Endereco endereco : cliente.getEnderecos()) {
            if (endereco.getIdEndereco() != null && endereco.getTipoEndereco() != null && endereco.getTipoEndereco().equals(tipoEndereco)) {
                montaEndereco(endereco);
                enderecoPreenchido = Boolean.TRUE;
            }
        }
        if (!enderecoPreenchido) {
            Endereco newEndereco = new Endereco();
            newEndereco.setTipoEndereco(tipoEndereco);
            montaEndereco(newEndereco);
            cliente.getEnderecos().add(newEndereco);
            newEndereco.getClientes().add(cliente);
        }

        TimeFutebol timeFutebol = (TimeFutebol) jComboBoxTimeFutebol.getSelectedItem();
        cliente.setTimeFutebol(timeFutebol);
        cliente.setNomeCliente(nome);
        cliente.setEmail(email);
        cliente.setDataCadastro(new Date());
        cliente.setDataNascimento(dataNasc);
        cliente.setSexo(sexoStr != null ? Sexo.valueOf(sexoStr) : null);
        cliente.setCpf(cpfStr.replaceAll("-", "").replaceAll("\\.", ""));
        motaHashTelefone();

        ClienteJpaController controllerCliente = new ClienteJpaController();
        try {
            if (cliente.getIdCliente() == null) {
                controllerCliente.create(cliente);
            } else {
                controllerCliente.edit(cliente);
            }
            JOptionPane.showMessageDialog(this, "Cliente salvo com sucesso!", "Atualização de Cliente", JOptionPane.INFORMATION_MESSAGE);
        } catch (NonexistentEntityException ex) {
            JOptionPane.showMessageDialog(this, "O cliente não pode ser salvo\ncomunique ao analista responsável!", "Atualização de Cliente", JOptionPane.INFORMATION_MESSAGE);
            Logger.getLogger(CadastroCliente.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(this, "O cliente não pode ser salvo\ncomunique ao analista responsável!", "Atualização de Cliente", JOptionPane.INFORMATION_MESSAGE);
            Logger.getLogger(CadastroCliente.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private String getSexo(ClientePessoaFisica cliente) {
        if (cliente.getSexo() == null) {
            return "[Selecione]";
        }
        if (cliente.getSexo().toString().equals("F")) {
            return "Feminino";
        } else if (cliente.getSexo().toString().equals("M")){
            return "Masculino";
        }
        return "[Selecione]";
    }

    private String getCPF(ClientePessoaFisica cliente) {
        return cliente.getCpf() != null ? cliente.getCpf() : "";
    }

    private void montaEndereco(Endereco endereco) {

        String rua = jTextFieldRua.getText();
        String numero = jTextFieldNumero.getText();
        String complemento = jTextFieldComplemento.getText();
        String bairro = jTextFieldBairro.getText();
        String cep = jFormattedTextFieldCep.getText();
        Cidade cidade = (Cidade) jComboBoxCidade.getSelectedItem();
        String referencia = jTextFieldReferencia.getText();

        endereco.setNomeRua(rua);
        endereco.setNumero(numero != null && !numero.equals("") ? Long.parseLong(numero): null);
        endereco.setComplemento(complemento);
        endereco.setBairro(bairro);
        endereco.setCep(cep != null && !cep.equals("") ? Long.parseLong(cep.replaceAll("-", "").trim()) : null);
        endereco.setReferencia(referencia);
        endereco.setCidade(cidade);
    }

    private void motaHashTelefone() {
        String telRes = jFormattedTextFieldTelRes.getText();
        String telCel = jFormattedTextFieldTelCel.getText();
        String telCom = jFormattedTextFieldTelCom.getText();

        Telefone tRes = criarTelefone(TipoTelefone.RESIDENCIAL, telRes);
        Telefone TCel = criarTelefone(TipoTelefone.CELULAR, telCom);
        Telefone TCom = criarTelefone(TipoTelefone.COMERCIAL, telCel);

        alteraTelefone(cliente.getTelefones(), tRes);
        alteraTelefone(cliente.getTelefones(), TCel);
        alteraTelefone(cliente.getTelefones(), TCom);
    }

    private void alteraTelefone(List<Telefone> telefones, Telefone newTel) {
        if (newTel == null)
            return;
        for (Telefone telefone : telefones) {
            if (telefone.getTipoTelefone().equals(newTel.getTipoTelefone())) {
                telefone.setDdd(newTel.getDdd());
                telefone.setNumeroTelefone(newTel.getNumeroTelefone());
                return;
            }
        }
        telefones.add(newTel);
    }

    private Telefone criarTelefone(TipoTelefone tipoTelefone, String numTelefone) {
        if (numTelefone.trim().length() != 14)
            return null;
        Telefone telefone = new Telefone();
        telefone.setTipoTelefone(tipoTelefone);
        telefone.setDdd(Integer.parseInt(numTelefone.substring(1, 3)));
        telefone.setNumeroTelefone(Long.valueOf(numTelefone.substring(5, 9) + numTelefone.substring(10, 14)));
        return telefone;
    }

    private void preencherCamposEndereco(Endereco endereco, Boolean isSelecione) {
        jTextFieldRua.setText(endereco.getNomeRua() != null && !isSelecione ? endereco.getNomeRua() : "");
        jTextFieldNumero.setText(endereco.getNomeRua() != null && !isSelecione ? endereco.getNumero().toString() : "");
        jTextFieldComplemento.setText(endereco.getComplemento() != null && !isSelecione ? endereco.getComplemento() : "");
        jTextFieldBairro.setText(endereco.getBairro() != null && !isSelecione ? endereco.getBairro() : "");
        jFormattedTextFieldCep.setText(endereco.getCep() != null && !isSelecione ? endereco.getCep().toString() : "");
        // TODO - colocar aki estado
        // TODO - colocar aki cidade
        jTextFieldReferencia.setText(endereco.getReferencia() != null ? endereco.getReferencia() : "");
    }

    private void carregarEstados() {
        EstadoJpaController controller = new EstadoJpaController();
        List<Estado> estados = controller.findEstadoEntities();
        jComboBoxEstado.setModel(new DefaultComboBoxModel(estados.toArray()));
        jComboBoxEstado.setSelectedItem(endereco.getCidade() != null ? endereco.getCidade().getEstado(): null);
        Endereco endereco = carregarEndereco(TipoEndereco.COMERCIAL, Boolean.TRUE);
        carregarCidade(endereco.getCidade() != null ? endereco.getCidade().getEstado() : null);

    }

    private Date converteData(String dataStr) {
        Date data = new Date();
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
            data = sdf.parse(dataStr);
        } catch (ParseException ex) {
            return null;
        } catch (Exception e) {
            return null;
        }
        return data;
    }

    private void carregarTimeFutebol() {
        TimeFutebolJpaController controler = new TimeFutebolJpaController();
        jComboBoxTimeFutebol.setModel(new DefaultComboBoxModel(controler.findTimeFutebolEntities().toArray()));
    }

    private void carregarCidade(Estado estado) {
        if (estado == null)
            return;
        CidadeJpaController controller = new CidadeJpaController();
        List<Cidade> cidades = cidades = controller.findCidadeEntities(estado);
        jComboBoxCidade.setModel(new DefaultComboBoxModel(cidades.toArray()));
        Endereco endereco = carregarEndereco(TipoEndereco.COMERCIAL, Boolean.TRUE);
        if (endereco.getCidade() != null) {
            jComboBoxCidade.setSelectedItem(endereco.getCidade());
        }
    }
    /**
     *
     * @param tipoEndereco tipo de endereco que deseja recuperar da lista
     * @param primeiroDaLista se definico como true retorna o primeiro endereco
     *        da lista caso, nao tenha o tipo solicitado na lista
     * @return endereco
     */
    public Endereco carregarEndereco(TipoEndereco tipoEndereco, Boolean primeiroDaLista) {
        if (tipoEndereco == null || cliente == null || cliente.getEnderecos().size() == 0) {
            return new Endereco();
        }
        Set<Endereco> enderecos = cliente.getEnderecos();
        for (Endereco endereco : enderecos) {
            if (endereco.getTipoEndereco().equals(tipoEndereco)) {
                return endereco;
            }
        }
        return primeiroDaLista ? enderecos.iterator().next() : new Endereco();
    }

    public String getQtdPontos() {
        return qtdPontos;
    }

    public void setQtdPontos(String qtdPontos) {
        this.qtdPontos = qtdPontos;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonQtdPontos;
    private javax.swing.JButton jButtonSalvar;
    private javax.swing.JComboBox jComboBoxCidade;
    private javax.swing.JComboBox jComboBoxEstado;
    private javax.swing.JComboBox jComboBoxSexo;
    private javax.swing.JComboBox jComboBoxTimeFutebol;
    private javax.swing.JComboBox jComboBoxTipoEndereco;
    private javax.swing.JFormattedTextField jFormattedTextFieldCPF;
    private javax.swing.JFormattedTextField jFormattedTextFieldCep;
    private javax.swing.JFormattedTextField jFormattedTextFieldDataNascimento;
    private javax.swing.JFormattedTextField jFormattedTextFieldTelCel;
    private javax.swing.JFormattedTextField jFormattedTextFieldTelCom;
    private javax.swing.JFormattedTextField jFormattedTextFieldTelRes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabelBairro;
    private javax.swing.JLabel jLabelCPF;
    private javax.swing.JLabel jLabelCep;
    private javax.swing.JLabel jLabelCidade;
    private javax.swing.JLabel jLabelComplemento;
    private javax.swing.JLabel jLabelDataNasc;
    private javax.swing.JLabel jLabelEmail;
    private javax.swing.JLabel jLabelEstado;
    private javax.swing.JLabel jLabelNome;
    private javax.swing.JLabel jLabelNumero;
    private javax.swing.JLabel jLabelPreferencias;
    private javax.swing.JLabel jLabelReferencia;
    private javax.swing.JLabel jLabelRua;
    private javax.swing.JLabel jLabelTelCel;
    private javax.swing.JLabel jLabelTelCom;
    private javax.swing.JLabel jLabelTelRes;
    private javax.swing.JLabel jLabelTextoEndereco;
    private javax.swing.JLabel jLabelTimeFutebol;
    private javax.swing.JLabel jLabelTipoEndereco;
    private javax.swing.JLabel jLabelTituloCadCliente;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTextField jTextFieldBairro;
    private javax.swing.JTextField jTextFieldComplemento;
    private javax.swing.JTextField jTextFieldEmail;
    private javax.swing.JTextField jTextFieldNome;
    private javax.swing.JTextField jTextFieldNumero;
    private javax.swing.JTextField jTextFieldReferencia;
    private javax.swing.JTextField jTextFieldRua;
    // End of variables declaration//GEN-END:variables
    private String qtdPontos;

}
